73
Build Your Own Remote Control
73
4.3 STANDARD FUNCTIONS
A standard function can be used to locate and open the presentation. The standard func
tion belongs to a class of similar functions commonly referred to as “Application”. The
function itself (Application.FileDialog) returns an object of type FileDialog, which
stores the name and path chosen and can be queried later on to use in operations.
Another standard function (Presentations.Open) is used to open the powerpoint
presentation file and while opening can be set to a slide show mode by a parameter
called ShowType.
Here is the code that does this:
STEP 1
Sub SlideMover()
Dim ie As Object
Dim form As Variant
Dim pptSlide As Slide
Dim pptLayout As CustomLayout
Dim button As Variant
Dim LR As Integer
Dim var As String
Dim var1 As Object
Dim oHEle As HTMLUListElement ‘ Create HTML element (<ul>) object.
Dim sldOne As Slide
Dim MyCallout As Shape
Dim dlgOpen As FileDialog
ActivePresentation.SlideShowWindow.View.Exit
Set dlgOpen = Application.FileDialog(Type:=msoFileDialogOpen)
With dlgOpen
.AllowMultiSelect = False
.Show
End With
filepath = dlgOpen.SelectedItems.Item(1)
Set objPresentation = Presentations.Open(filepath, True)
objPresentation.Windows(1).Activate
With objPresentation.SlideShowSettings
.ShowType = ppShowSpeaker
.Run.View.AcceleratorsEnabled = False
End With
SlideNumber = 1
PreviousLen = 1
Call HeavyLifting
End Sub
4.4 READING THE GOOGLEDOCS INPUT
Next, we need to read the input from the googledocs document. This is done by the
subroutine called “HeavyLifting” in the code in step 1.